If you have not yet read the IG AppleScript Intro file, please do that before going on with this one.
Classes
Classes are the kinds of objects which InfoGenie recognizes in its Apple Events. A class may have properties and/or be composed of other classes.
Most of InfoGenie's classes are text objects. These include characters, words, paragraphs, cells, records, and datafiles. A datafile contains records, which may consist of cells and/or paragraphs, which consist of words, which in turn consist of characters. We may also look at a datafile as containing paragraphs, words, and characters, and a record as containing words and characters. There is also the text class, which is simply a range of characters, and the insertion point class, which refers to locations between characters. The term for a class which may be contained in another class, such as characters in a word, is element. So, a character is an element of a word, a cell is an element of a record, and so on.
In reality, except for the insertion point class, all the text object classes are just ranges of characters. Each text object has at least two properties—length, which is the number of characters in the object, and offset, which is the offset of the first character in the object from the start of the datafile. Insertion points contain no characters, so they always have a length of zero.
In addition to length and offset, cells have a name property. Along with the normal reference by index, which can be used with all text objects, cells may be referred to by name. Cells are the only text objects which are specified only in relation to a record. For example, we can refer to the 2000th word of a datafile which might contain 30,000 words, but even if a datafile has 3000 records with 10 cells each, we cannot refer to the 2000th cell of the datafile. Instead, we must refer to the 10th cell of the 200th record. In general, it is probably safer to refer to cells by name, rather than by index.
The datafile class has a large number of properties. Its properties include: current record (number of the currently displayed record), field based (true if field-based, false if freeform), name (the name of the datafile), selection (content of selected text), selection start (offset of the first character of the current selection from start of datafile ), selection length (number of characters in the current selection), text block (extracted from the current record in accordance with Text Block Layout settings), view (Basic View or List View), font (font for Basic View text), size (point size for Basic View text), and style (style for Basic View text). The properties related to selections may be useful when dealing with the result of the find event, which results in the selection of the text which it finds. Unlike windows, datafiles are indexed by the order in which they were opened, not by the order in which their windows are stacked. As with cells, it is probably safer to refer to datafiles by name, rather than by index, since that will not change when other datafiles are opened or closed.
The two classes which are not text objects are the application class, which refers to InfoGenie, itself, and the file class, which refers to files on disk. The file class has no properties, while the application class has two, name and version. Neither of these classes has any elements.
InfoGenie does not support two common classes, document and window. A document would be essentially the same as a datafile. A window is much like a datafile, except that it might have some additional properties, such as the window bounds, which InfoGenie does not support in its Apple Events. It was felt that their inclusion would complicate matters without adding any utility.
Below is a full explanation of all the InfoGenie classes, based on its Apple Events dictionary.
(Note: In the following, [r/o] means that a property is read-only. That is, its value can be read (using the get event), but cannot be changed. If there is no [r/o], then the value of the property can be changed (using the set event).
Class application - An application program
Plural form -
applications
Properties -
current datafile string [r/o] -- The name of the current (frontmost) datafile
Datafile menu list of strings [r/o] -- The names of the datafiles in the Datafiles menu
name string [r/o] -- The name of the application
version string [r/o] -- The version of the application
Class cell - cell (a field within an individual record)
Plural form -
cells
Elements -
cell by name, by numeric index, as a range of elements, satisfying a test
character by numeric index, as a range of elements, satisfying a test
insertion point before/after another element
paragraph by numeric index, as a range of elements, satisfying a test
record by numeric index, as a range of elements, satisfying a test
text as a range of elements
word by numeric index, as a range of elements, satisfying a test
Properties -
length integer [r/o] -- Length of text in cell (number of characters)
name string -- Name of the field containing the cell
offset integer [r/o] -- Offset of the first character of a cell from the start of the
datafile (1-based)
Class character - A character
Plural form -
characters
Elements -
character by numeric index, as a range of elements, satisfying a test
insertion point before/after another element
paragraph by numeric index, as a range of elements, satisfying a test
record by numeric index, as a range of elements, satisfying a test
text as a range of elements
word by numeric index, as a range of elements, satisfying a test
Properties -
length integer [r/o] -- Length of character (always 1)
offset integer [r/o] -- Offset of a character from the start of the datafile (1-based)
Class datafile - An InfoGenie datafile
Plural form -
datafiles
Elements -
cell by name, by numeric index, as a range of elements, satisfying a test
character by numeric index, as a range of elements, satisfying a test
datafile by numeric index, by name
insertion point before/after another element
paragraph by numeric index, as a range of elements, satisfying a test
record by numeric index, as a range of elements, satisfying a test
text as a range of elements
word by numeric index, as a range of elements, satisfying a test
Properties -
cell names list of strings [r/o] -- Names of the cells (fields) in the datafile
current record integer [r/o] -- Number of the currently displayed record
field based boolean [r/o] -- Is the datafile field-based? (true if field-based, false if
freeform)
name string [r/o] -- The name of the datafile
selection string [r/o] -- Content of selected text
selection start integer [r/o] -- Offset of the first character of the current selection
from start of datafile (1-based)
selection length integer [r/o] -- Number of characters in the current selection
text block string [r/o] -- Text block (usually an address), extracted from the current
record in accordance with Text Block Layout settings
view basic view/list view -- Current view - Basic View or List View
font string -- Font for Basic View text
size integer -- Point size for Basic View text
style plain/bold/italic/outline/shadow/underline -- Style for Basic View text
Class file - A file
Plural form -
files
Class insertion point - An insertion location between two objects
Plural form -
insertion points
Properties -
length integer [r/o] -- Length of insertion point (always zero)
offset integer [r/o] -- Offset of an insertion point from start of datafile (1-based)
Class paragraph - A paragraph
Plural form -
paragraphs
Elements -
character by numeric index, as a range of elements, satisfying a test
insertion point before/after another element
paragraph by numeric index, as a range of elements, satisfying a test
record by numeric index, as a range of elements, satisfying a test
text as a range of elements
word by numeric index, as a range of elements, satisfying a test
Properties -
length integer [r/o] -- Length of paragraph (in characters - includes the ending
carriage return, if there is one)
offset integer [r/o] -- Offset of the first character of a paragraph from the start of the
datafile (1-based)
Class record - record (same as a row in most database applications)
Plural form -
records
Elements -
cell by name, by numeric index, as a range of elements, satisfying a test
character by numeric index, as a range of elements, satisfying a test
insertion point before/after another element
paragraph by numeric index, as a range of elements, satisfying a test
record by numeric index, as a range of elements, satisfying a test
text as a range of elements
word by numeric index, as a range of elements, satisfying a test
Properties -
length integer [r/o] -- Length of text in record (in characters)
offset integer [r/o] -- Offset of the first character of a record from the start of the
datafile (1-based)
Class text - a range of text
Elements -
cell by name, by numeric index, as a range of elements, satisfying a test
character by numeric index, as a range of elements, satisfying a test
insertion point before/after another element
paragraph by numeric index, as a range of elements, satisfying a test
record by numeric index, as a range of elements, satisfying a test
text as a range of elements
word by numeric index, as a range of elements, satisfying a test
Properties -
length integer [r/o] -- Length of text (in characters)
offset integer [r/o] -- Offset of the first character of a text range from the start of the
datafile (1-based)
Class word - A word
Plural form -
words
Elements -
character by numeric index, as a range of elements, satisfying a test
insertion point before/after another element
paragraph by numeric index, as a range of elements, satisfying a test
record by numeric index, as a range of elements, satisfying a test
text as a range of elements
word by numeric index, as a range of elements, satisfying a test
Properties -
length integer [r/o] -- Length of text in word (in characters)
offset integer [r/o] -- Offset of the first character of a word from the start of the
datafile (1-based)
Events
See the IG AppleScript Events file for information on Apple Events supported by InfoGenie.